]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ScreenShield: hide the cursor while the lock screen is on
authorGiovanni Campagna <gcampagna@src.gnome.org>
Fri, 31 Aug 2012 15:51:32 +0000 (17:51 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 6 Nov 2012 22:10:01 +0000 (23:10 +0100)
While the screen is locked and the cursor is not moved, the mouse
cursor should be hidden, to indicate the machine is idle.

https://bugzilla.gnome.org/show_bug.cgi?id=682535

js/ui/screenShield.js

index 86dcf7dac4cf5d31e1d1b0ca4f2a3bd662fa0c45..e47f0aa7c74a7227a3e0cdf073ac80bd35b53f3e 100644 (file)
@@ -704,6 +704,8 @@ const ScreenShield = new Lang.Class({
             this._lockScreenGroup.hide();
         }
 
+        global.stage.show_cursor();
+
         if (Main.sessionMode.currentMode == 'lock-screen')
             Main.sessionMode.popMode('lock-screen');
     },
@@ -792,6 +794,16 @@ const ScreenShield = new Lang.Class({
         this._arrowAnimationId = Mainloop.timeout_add(6000, Lang.bind(this, this._animateArrows));
         this._animateArrows();
 
+        let motionId = global.stage.connect('captured-event', function(stage, event) {
+            if (event.type() == Clutter.EventType.MOTION) {
+                global.stage.show_cursor();
+                global.stage.disconnect(motionId);
+            }
+
+            return false;
+        });
+        global.stage.hide_cursor();
+
         this._lockScreenState = MessageTray.State.SHOWN;
         this._lockScreenGroup.fixed_position_set = false;
         this._lockScreenScrollCounter = 0;